package com.ayoka.ui.member;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;

import com.ayoka.R;
import com.ayoka.base.BaseActivity;
import com.ayoka.databinding.ActivityOpenMemberSuccessBinding;
import com.ayoka.mvp.JoinMVP.IJoinView;
import com.ayoka.mvp.JoinMVP.JoinPresenter;
import com.jcp.baselibrary.model.ToolBarOptions;
import com.jcp.baselibrary.utils.StringUtil;


/**
 * @author jcp
 * @ClassName: TopicListActivity
 * @Description:
 * @date 2018-12-28 下午4:21:18
 */
public class OpenMemberSuccessActivity extends BaseActivity<ActivityOpenMemberSuccessBinding, JoinPresenter> implements IJoinView {

    public static void start(Activity activity) {
        Intent intent = new Intent(activity, OpenMemberSuccessActivity.class);
        activity.startActivity(intent);
    }

    @Override
    public int getContentLayout() {
        return R.layout.activity_open_member_success;
    }

    @Override
    protected void initViews() {
        mDataBinding.btnGoToStudy.setOnClickListener(this);
    }

    @Override
    protected void initData(Bundle savedInstanceState) {
        ToolBarOptions options = new ToolBarOptions();
        options.navigateId = R.mipmap.icon_close_black_cross;
        setCustomToolBar(mDataBinding.customToolbar.toolbar, options);

        mPresenter.getJoinCount();
    }

    @Override
    protected JoinPresenter getPresenter() {
        return new JoinPresenter();
    }

    @Override
    public void onClick(View view) {
        super.onClick(view);
        if (view == mDataBinding.btnGoToStudy){
            finish();
        }
    }

    @Override
    public void configJoinCount(Long data) {
        mDataBinding.tvParentNumber.setText(StringUtil.formatString(R.string.format_parent_number, data));
    }

    @Override
    public void onLoginCallback(boolean isSuccess) {

    }
}
